﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="WebApplication2.Web.login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>登录页</title>
	<%--<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">--%>
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="../css/font.css" rel="stylesheet" />
    <link href="../css/xadmin.css" rel="stylesheet" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../lib/layui/layui.js"></script>
    <script src="../js/xadmin.js"></script>
    <script src="../js/public.js"></script>
  
</head>

    <body class="login-bg">

    <div class="login layui-anim layui-anim-up">
        <div class="message">装备制造部项目管理系统</div>
        <div id="darkbannerwrap"></div>

        <form method="post" class="layui-form" action=" ">
            <input id="username" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
            <hr class="hr15">
            <input id="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width: 100%;" type="submit">
            <hr class="hr20">
            <div style="">
                <a href="./Forgot.aspx">忘记密码 </a>
                <span> | </span>
                <a href="./AddUser.aspx" style="">注册</a>

            </div>

            <hr class="hr20">
        </form>
    </div>

        <script>
        $(function () {
            layui.use(['form','layer'], function () {
                var form = layui.form;
                var layer = layui.layer;
                form.on('submit(login)', function (data) {
                        login();
                    return false;
                });

                form.on('submit(forget)', function (data) {
                    window.location.href("www.baidu.com");
                    return false;
                });
            });
        })

        function login()
        {
            var objEmLogin = new Object();
            objEmLogin.empAccount  =($("#username").val());
            objEmLogin.pwd = ($("#password").val());
            myAjax("Login.ashx", "Login", objEmLogin, false, function (data) {
                console.log(data);
                if (data.Code == 1) {
                    location = "Index.aspx";
                }
                if (data.Code == 2) {
                    layer.msg('密码错误');
                }
                if (data.Code == 3) {
                    layer.msg('没有此账号');
                }
            }, function () {
                layer.msg('发生了一些预期之外的错误，请检查网络是否能连接到服务器');
            });
        }
        
    </script>
    <!-- 底部结束 -->
</body>
</html>
